<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ page import="net.sapfree.user.vo.UserVO"%>
<%@ page import="net.sapfree.core.db.RecordSet"%>
<%@ page import="net.sapfree.core.db.Record"%>
<%@ page import="net.sapfree.article.ArticleHandler"%>
<%@ page import="net.sapfree.core.util.CutHtml"%>
<%@ page import="net.sapfree.common.Constants"%>
<%@ taglib uri="/WEB-INF/sapfree-info.tld" prefix="sap"  %> 

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String quanId=request.getParameter("quanId");
if(quanId==null||"".equals(quanId)){
	quanId="123";
}
 
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>我的飞客</title>
<link href="<%=path%>/include/styleBase/css/ostable.css" rel="stylesheet"></link>
<link href="<%=path%>/include/styleBase/css/leftPage.css" rel="stylesheet"></link>
<link href="<%=path%>/include/styleBase/css/styleBase.css" rel="stylesheet"></link>
<link href="<%=path%>/include/styleBase/css/fontStyle.css" rel="stylesheet"></link>
<link href="<%=path%>/include/styleBase/css/exchangeType.css" rel="stylesheet"></link>
<link href="<%=path%>/include/lhgdialog/lhgdialog.css" rel="stylesheet"></link>

<script type="text/javascript" src="<%=path%>/include/styleBase/js/jquery.js"></script>
<script type="text/javascript" src="<%=path%>/include/styleBase/js/style.js"></script>

<script type="text/javascript" src="<%=path%>/include/lhgdialog/lhgcore.min.js"></script>
<script type="text/javascript" src="<%=path%>/include/lhgdialog/lhgdialog.js"></script>



<script>
	function submitMessage(){
	    $.ajax({
			url: '/sapfree/servlet/MessageBoradServlet?method=submitMessage', 
			data:{QuanId:'<%=quanId%>',messageTxt:$('#messageInput').val()},
			dataType: 'text',
			type: "post",
			error:function(XMLHttpRequest,textStatus,errorThrown){alert(errorThrown);},
			success: function(data) {
				if(data=="true"){
					getJsonMessage('<%=quanId%>');
					addCount();
					$('#messageInput').val("");
				}else{
				   alert("留言未成功，请刷新本页面后重试！");
				}
			}
		});
	}
	
	function addCount(){
		var cu=$('#messageCount').text();
		cu=parseInt(cu);
		cu=cu+1;
		$('#messageCount').text(cu);
	}
	


</script>

<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
</head>
<body>
<%@include file="../include/jsp/top.jsp"%>
<sap:Quan id="<%=quanId %>">

<table border="0" cellpadding="0" cellspacing="0" width="1000" align="center" style="margin:0px auto;">
	<tr>
    	<td width="114" height="79" align="center" valign="middle">
        <img src="<%=path%>/<sap:write property='QUAN_YSZHAOPIAN'/>" width="79" height="71">        </td>
      	<td width="12">&nbsp;</td>
      	<td width="590">
  		<table border="0" cellpadding="0" cellspacing="0" width="97%">
			<tr><td height="25" colspan="5" class="blueBold14"><sap:write property="QUAN_NAME"   /></td></tr>
            <tr><td height="25" colspan="5" class="blackNormal12"><sap:write property="QUAN_MEMO"   /></td></tr>
            <tr>
            	<td width="25%" height="25" class="blackNormal12">圈主：<span class="lightBlueBold12"><sap:write property="QUAN_OWNERNAME"   /></span></td>
              	<td width="16%" class="blackNormal12">成员数：<sap:write property="QUAN_MEMBERCOUNT"   /></td>
              	<td width="16%" class="blackNormal12">话题数：<sap:write property="QUAN_TOPICCOUNT"   /></td>
              	<td width="18%" class="blackNormal12">留言数：<span id="messageCount"><sap:write property="QUAN_COMMENTCOUNT"   /></span></td>
              	<td width="25%" class="blackNormal12"><p>投票数：<sap:write property="QUAN_VOTECOUNT"   /></p>
           	    </td>
          </tr>
        </table>
      </td>
      	<td width="284" class="blackNormal12">
        创建时间：<sap:write property="QUAN_CREATETIME"   /><br>
        圈子积分：3290(false)
        </td>
  	</tr>
    <tr><td height="10"></td></tr>
</table>


<table border="0" cellpadding="0" cellspacing="0" width="980" align="center"  style="margin:0px auto;">
	<tr>
    	<td width="230" align="center" valign="top" bgcolor="#CCCCCC">
        	<table border="0" cellpadding="0" cellspacing="0" width="95%" bgcolor="#CCCCCC" >
            	<tr><td height="8"></td></tr>
            	<tr>
                <td>
                <table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#FFFFFF">
                    <tr>
                      <td colspan="2" class="userName14" height="30" valign="middle">&nbsp;&nbsp;操作面板</td>
                    </tr>
                    <tr>
                    	<td align="center">
                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC" width="99%">
                        	<tr>
                            	<td bgcolor="#FFFFFF" width="50%" class="lightBlueNormal12" height="30">
                                <img src="../images/bullet_orange.gif" align="absmiddle">&nbsp;<A href="#3" onClick="qiandao()">签到</A>
                                </td>
                                <td bgcolor="#FFFFFF" width="50%" class="lightBlueNormal12" height="30">
                                <img src="../images/bullet_orange.gif" align="absmiddle"><a href="<%=path %>/article/articlelist?method=newBlog" class="lightBlueNormal12" target="_blank">创建话题</a>                                </td>
                            </tr>
                            <tr>
                            	<td bgcolor="#FFFFFF" width="50%" class="lightBlueNormal12" height="30">
                                <img src="../images/bullet_orange.gif" align="absmiddle">&nbsp;邀请好友
                                </td>
                                <td bgcolor="#FFFFFF" width="50%" class="lightBlueNormal12" height="30">
                                <img src="../images/bullet_orange.gif" align="absmiddle">&nbsp;退出圈子
                                </td>
                            </tr>
                        </table>                        
                        </td>
                    </tr>
                    <tr><td colspan="2" height="10"></td></tr>
                </table>
                </td>
                </tr>
            </table>
            <br>
            
            <table border="0" cellpadding="0" cellspacing="0" width="95%" bgcolor="#CCCCCC">
            	<tr>
                <td>
               
                <jsp:include   page="dongtai.jsp"    flush="true">   
		             <jsp:param    name="QuanID"    value="<%=quanId %>"    />   
				</jsp:include>
               

                </td>
                </tr>
            </table>
            
            <br>
            
            <table border="0" cellpadding="0" cellspacing="0" width="95%" bgcolor="#CCCCCC">
            	<tr>
                <td>
                <table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#FFFFFF">
                    <tr>
                      <td colspan="3" class="userName14" height="30" valign="middle">&nbsp;&nbsp;威望成员</td>
                    </tr>
                    
                 <% int i=0; %>
                 <sap:MemberList quanuuid="<%=quanId %>" count="6">
                 	<sap:Member>
                    <%
					if(i%3==0){
					%>
                 	 <tr>
                        <td align="center" width="73" height="60">
                        	<img src="<sap:write property='PI_YSZHAOPIAN' />" width="50" height="60"><br>
                        	<sap:write property="PI_FIRSTNAME" /><sap:write property="PI_LASTNAME" />
                        </td>
                    <%
					}else if(i%3==2){
					%>
                    	<td align="center" width="73" height="60">
                        	<img src="<sap:write property='PI_YSZHAOPIAN' />" width="50" height="60"><br>
                        	<sap:write property="PI_FIRSTNAME" /><sap:write property="PI_LASTNAME" />
                        </td>
                    </tr>
                    <%
					}else{
					%>
                    	<td align="center" width="73" height="60">
                        	<img src="<sap:write property='PI_YSZHAOPIAN' />" width="50" height="60"><br>
                        	<sap:write property="PI_FIRSTNAME" /><sap:write property="PI_LASTNAME" />
                        </td>
                    <%
					}
					i++;
					%>
                   
                     </sap:Member>
                 </sap:MemberList>
                 	<%
					if(i%3==0){
					%>
                    	<td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <%
					}else if(i%3==1){
					%>
                    	<td>&nbsp;</td>
                    </tr>
                    <%
					}
					%>
					
                    
                    <tr><td colspan="3" height="10"></td></tr>
                </table>
                </td>
                </tr>
            </table>
        </td>
    	<td width="10"></td>
   	  <td align="left" width="750" valign="top">
      <!--主信息展示区-->
      
      <table border="0" cellpadding="0" cellspacing="0" width="98%" bgcolor="#666666">
      	<tr>
        <td>
      	<table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#FFFFFF">
      	<tr>
          	<td width="5" align="right" height="35"></td>
            <td class="blueBold14 tableHeadTitle" width="328">&nbsp;&nbsp;<img src="../images/medal_gold.png" align="absmiddle">&nbsp;最新话题</td>
            <td width="329" align="right" height="35" class="lightBlueBold12 tableHeadTitle">更多话题&nbsp;&nbsp;</td>
            <td width="6" align="right" height="35"></td>
        </tr>
        
        <%int eventIndex=0; %>
       <sap:QuanTopicList filterQuanUuid="<%=quanId %>" count="5">
          <sap:QuanTopic>
          <%eventIndex++; %>
        <tr>
        	<td width="5" align="right"></td>
          	<td height="35" colspan="2" align="left" class="blueBold14">
            <sap:write property="AI_TITLE"/>        </td>
            <td width="6" align="right"></td>
        </tr>
        <tr>
            <td width="5"></td>
            <td class="blackNormal12" height="25" colspan="2" align="left">
            作者：<span class="lightBlueBold12"><sap:write property="AI_PERSONNAME" /></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            标签：
            <%
            String articleId=(String)pageContext.getAttribute("articleId");
            String htmlContent=(String)pageContext.getAttribute("htmlContent");
            RecordSet tagRst = ArticleHandler.getTagInfoByArtId(articleId);
            for(int j=0;j<tagRst.size();j++){
               Record tagrecord = tagRst.get(j);
            %>
            <a href="#2011" onClick="seaBlogByTag('<%=tagrecord.getString("AT_TAGUUID","")%>');"><%=tagrecord.getString("AT_TAGNAME","")%></a>
            <%}%>
            </td>
            <td width="6"></td>
        </tr>
        <tr>
        	<td width="5" align="right"></td>
        	<td colspan="2" class="blackNormal12">
 				<%=CutHtml.subStringHTML(htmlContent,Constants.ARTICLE_CUT_LENGTH, "...")%>
			 </td>
            <td width="6" align="right"></td>
        </tr>
        <tr>
        	<td width="10"></td>
            <td class="greyNormal12" align="left" height="30">阅读（<sap:write property="AI_READCOUNT"/>）&nbsp;&nbsp;|&nbsp;&nbsp;评论（<sap:write property="AI_DISCUSSCOUNT"/>）&nbsp;&nbsp;|&nbsp;&nbsp;收藏（<sap:write property="AI_UPCOUNT"/>）</td>
            <td class="orangeBold12" align="right" style="cursor:pointer;" onClick="blogDetail('<sap:write property="AI_UUID"/>')">查看全文</td>
            <td width="10"></td>
        </tr>
        <tr><td height="20" colspan="5"> <div style="border-top:1px dotted #CCCCCC;height: 1px;overflow:hidden; width:98%;"></div></td></tr>
                        
        <%
      	  String d=(String)pageContext.getAttribute("articleId");
      	%>
        <sap:VoteList articleId="<%=d %>">
          <sap:Vote>
           <tr><td height="10"></td></tr>
         
            <tr>
            	<td colspan="3" align="center">
				      <table border="0" cellpadding="0" cellspacing="1" width="98%" bgcolor="#666666">
				      <tr>
				      	<td align="center" bgcolor="#FFFFFF">
				      	
				      	<table border="0" cellpadding="0" cellspacing="0" width="98%">
            	<tr>
                	<td height="30" colspan="2" class="blackBold14"><img src="../images/chart_bar_edit.png">&nbsp;<sap:write property="VI_TITLE"/>  </td>
                </tr>
                <tr><td height="25" colspan="2" class="greyNormal12">
                		发起时间：<sap:write property="VI_STARTDATE"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                		截止时间：<sap:write property="VI_CLOSEDATE"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                		投票人数：<sap:write property="RCOUNT"/>人</td></tr>
                <tr><td height="5" colspan="2"></td></tr>
               
		           <%
			      	  String voteId=(String)pageContext.getAttribute("voteId");
			      	%>
				        	 <jsp:include   page="vote.jsp"    flush="true">   
						             <jsp:param    name="voteId"    value="<%=voteId %>"   />   
								</jsp:include>
								
                        
                        <tr><td height="10"></td></tr>
                    </table>                   
                    
                     </td>
                </tr>
          
            </table>
	        </td>
	      </tr>
  		</sap:Vote>
     </sap:VoteList>  
				      	
            <tr><td height="10"></td></tr>
            <tr>
            	<td colspan="3" align="center">
 							<jsp:include   page="dashiji.jsp"    flush="true">   
						             <jsp:param    name="articleId"    value="<%=d %>"   />   
						             <jsp:param    name="eventIndex"    value="<%=eventIndex %>"   /> 
								</jsp:include>
                </td>
            </tr>
            
            <tr><td height="10"></td></tr>
            
            <tr>
            	<td colspan="3" align="center">
						<jsp:include   page="discuss.jsp"    flush="true">   
						     <jsp:param    name="articleId"    value="<%=d %>"   />   
						     <jsp:param    name="eventIndex"    value="<%=eventIndex %>"   />
						 </jsp:include>
        	</td>
      </tr>
        
        </sap:QuanTopic>
    </sap:QuanTopicList>
             
	      </table>
	                </td>
	            </tr>
	             
	      </table>
	      </td>
	      </tr>
	      
    
      </table>
      </td>
   	  
    </tr>
    
    
         
</table>


</sap:Quan>


<br>
<table border="0" cellpadding="0" cellspacing="0" width="1000" align="center"  style="margin:0px auto;">
	<tr><td height="10"></td></tr>
	<tr><td><hr color="#999999" size="1" width="100%"></td></tr>
	<tr>
    	<td align="center" height="25">
        © 2011-2016 Sapfree.com
        </td>
    </tr>
    <tr>
    	<td align="center" height="25">
        联系我们&nbsp;&nbsp;隐私声明&nbsp;&nbsp;使用条款&nbsp;&nbsp;版权商标&nbsp;&nbsp;网站地图
        </td>
    </tr>
</table>
<br><br>
</body>

</html>